const businessColumns = [
    {
        prop: 'name',
        label: '模版名称',
        width: 250
    },
    {
        prop: 'classFullPathJson',
        label: '所属模块',
        width: 300
    },
    {
        prop: 'comment',
        label: '介绍说明',
        width: 250
    },
    {
        prop: 'creatorName',
        label: '创建人'
    },
    {
        prop: 'enabled',
        label: '启用'
    },
    {
        label: '操作',
        width: 300,
        operations: [
            {
                prop: 'edit',
                label: '编辑'
            },
            {
                prop: 'delete',
                label: '删除'
            },
            {
                prop: 'item_config',
                label: '业务步骤'
            }
        ]
    }
]

const classFormItems = [
    {
        label: '分类名称',
        prop: 'name',
        name: 'input',
        type: 'text',
        validation: true
    },
    {
        label: '启用',
        prop: 'enabled',
        name: 'checkbox'
    },
    {
        label: '是否首页显示',
        prop: 'homeShow',
        name: 'checkbox'
    },
    {
        label: '排序',
        prop: 'sequence',
        name: 'input',
        type: 'number',
        placeholder: '用于排序的数字，小的在前',
        validation: true
    }
]

const businessFormItems = [
    {
        label: '业务分类',
        prop: 'classIds',
        name: 'cascader',
        props: {
            value: 'id',
            label: 'name',
            children: 'subClasses'
        },
        validation: true
    },
    {
        label: '业务名称',
        prop: 'name',
        name: 'input',
        validation: true
    },
    {
        label: '业务需求',
        prop: 'comment',
        name: 'input',
        type: 'textarea',
        validation: true
    },
    {
        label: '启用',
        prop: 'enabled',
        name: 'checkbox'
    },
    {
        label: '操作时长',
        name: 'time-input-ex',
        items: [
            {
                minutes: {
                    label: '优秀',
                    prop: 'timeCostMinutesExcellent',
                    name: 'input',
                    type: 'number'
                },
                seconds: {
                    label: '秒',
                    prop: 'timeCostSecondsExcellent',
                    name: 'input',
                    type: 'number'
                }
            },
            {
                minutes: {
                    label: '良好',
                    prop: 'timeCostMinutesGood',
                    name: 'input',
                    type: 'number'
                },
                seconds: {
                    label: '秒',
                    prop: 'timeCostSecondsGood',
                    name: 'input',
                    type: 'number'
                }
            },
            {
                minutes: {
                    label: '一般',
                    prop: 'timeCostMinutesNormal',
                    name: 'input',
                    type: 'number'
                },
                seconds: {
                    label: '秒',
                    prop: 'timeCostSecondsNormal',
                    name: 'input',
                    type: 'number'
                }
            }
        ],
        validation: true
    },
    {
        label: '业务封面',
        prop: 'businessImageUrl',
        name: 'icon-upload',
        purpose: 'busicover',
        validation: true
    }
]

const options = [
    {
        value: 'refresh',
        label: '刷新'
    },
    {
        value: 'batchdelete',
        label: '批量删除'
    }
]

const operations = [
    {
        label: '刷新',
        prop: 'refresh',
        icon: 'fa fa-refresh'
    },
    {
        label: '新增',
        prop: 'add',
        icon: 'fa fa-plus-circle'
    },
    {
        label: '编辑',
        prop: 'edit',
        icon: 'fa fa-edit'
    },
    {
        label: '删除',
        prop: 'delete',
        icon: 'fa fa-times-circle'
    }
]

export default {
    business: {
        columns: businessColumns,
        options,
        operations,
        classFormItems,
        businessFormItems
    }
}
